

using System;

namespace Petaframe.Logging
{
	
	internal class LogEntryStandardFormatter : LogEntryFormatter
	{
		
		protected internal override String AsString(LogEntry aLogEntry) 
		{
			String appString = "";
			if ( aLogEntry.Application != null )
                appString = String.Format("[{0}] -- ", aLogEntry.Application);
			if ( aLogEntry.Category != null ) 
				try 
				{
                    appString = String.Format("{0}{{{1}}} --", appString, aLogEntry.Category);
				} 
				catch 
				{
				}
            return String.Format("{0}<{1}> -- {2} -- {3}", appString, aLogEntry.SeverityString, DateString(aLogEntry), aLogEntry.Message);
		}

		
		public LogEntryStandardFormatter(Logger.LoggingErrorHandler aLoggingErrorHandler) : base(aLoggingErrorHandler)
		{
		}
	}
}
